package com.atguigu.juc;

public enum  SeasonEnums {

    Spring(1,"春天"),Summer(2,"夏天"),autumn(3,"秋天"),winter(4,"冬天");

    private Integer retCode;
    private String retMessage;

    public Integer getterRetCode(){
        return retCode;
    }

    public String getterRetMessage(){
        return retMessage;
    }

    SeasonEnums(Integer retCode,String retMessage){
        this.retCode = retCode;
        this.retMessage =retMessage;
    }

    public static SeasonEnums forEach_SeasonEnums(int index){
        SeasonEnums[] seasonEnums = SeasonEnums.values();
        for (SeasonEnums element : seasonEnums)
        {
            if (index == element.getterRetCode()){
                return element;
            }
        }
        return null;
    }

}
